#include "mainmenu.h"

MainMenu::MainMenu(QWidget *parent):
    QMenuBar(parent)
{
    //Set properties.
    setContentsMargins(0, 0, 0, 0);
    //Create menus.
    for(int i=0; i<MenuCount; ++i)
    {
        m_menu[i] = new QMenu(this);
        //Append menu to menu bar.
        addMenu(m_menu[i]);
    }
    //Translate the menu data.
    retranslate();

}

void MainMenu::retranslate()
{
    //Translate all the menus.
    m_menu[File]->setTitle(tr("&File"));
    m_menu[Edit]->setTitle(tr("&Edit"));
    m_menu[View]->setTitle(tr("&View"));
    m_menu[Compile]->setTitle(tr("&Compile"));
    m_menu[Simulate]->setTitle(tr("&Simulate"));
    m_menu[Tools]->setTitle(tr("&Tools"));
    m_menu[Help]->setTitle(tr("&Help"));
}
